#!/bin/bash

#检验目录
test_path=$1

#检验类型
test_type=$2

rpmlinst_test()
{
	
	#记录src.rpm的数量
	local num=0 
	
	#搜索test_path目录下所有的test_type文件 spec rpm
	test_files=$(find "$test_path" -type f -name "*.${test_type}" | grep -v '.src.rpm')
	
	if [ $test_type = "src"];then
	
	
	for src in $srcrpm_files
	do
		echo -e "rpmlint test:$src\n"
		rpmlint $src
	done
}

#判断rpmlinst工具是否安装,未安装则安装
	command -v rpmlint >/dev/null 2>&1 
	if [ $? -ne 0 ];then
		echo "rpmlint no install"
		yum install -y rpmlinst 
		if [ $? -ne 0 ];then
			echo "install rpmlint failed !!!"
			exit 1
		fi
	fi#!/bin/bash

#检验目录
test_path=$1

#检验类型
test_type=$2

rpmlinst_test()
{
	
	#记录src.rpm的数量
	local num=0 
	
	#搜索test_path目录下所有的test_type文件 spec rpm
	test_files=$(find "$test_path" -type f -name "*.${test_type}" | grep -v '.src.rpm')
	
	if [ $test_type = "src"];then
	
	
	for src in $srcrpm_files
	do
		echo -e "rpmlint test:$src\n"
		rpmlint $src
	done
}

#判断rpmlinst工具是否安装,未安装则安装
	command -v rpmlint >/dev/null 2>&1 
	if [ $? -ne 0 ];then
		echo "rpmlint no install"
		yum install -y rpmlinst 
		if [ $? -ne 0 ];then
			echo "install rpmlint failed !!!"
			exit 1
		fi
	fi